Skip to main content

OTP

The Verify Phone process typically involves verifying a user's phone number through the use of a One-Time Password (OTP).

How to setup,

1 Go to Workspace > Workflows, and click on the flow created for Verify Phone. If you need understanding in creating a workflow, refer to the step-by-step guide here.

2 Hover over the plus (+) symbol and select Workflow. From the list, click Verify Phone to add it.

Verify Phone

3 Click on the newly added workflow, then select the General tab to customize your preferences.

General

Manage General

NameDescription
EnableThis toggle is enabled by default. When enabled, the particular workflow module begins its execution. Conversely, if disabled, the workflow module remains inactive and won't proceed.
RuleThis determines the criteria for triggering the particular workflow module. When the selected rule is evaluated, and is satisfied, the workflow proceeds as provided. If not, the workflow will not be executed. Note: If no rules are set, the workflow defaults to its standard action without any rule. For more information about the rules, refer here.

4 Then, click on the Configs tab to set the necessary configurations. When configuring the Verification Type, by default OTP is set, but there are two types available: OTP and OTP_LESS.

Configs

5 Choose OTP for Verification Type.

OTP

Manage Configs

NameDescription
Phone Verification Expiry DurationThis setting allows you to specify the duration for which the phone verification link or OTP (One-Time Password) remains valid. After this period, the verification process expires and users will need to request a new verification.
Email Verification OTP LengthYou can configure the length of the OTP (One-Time Password) used for email verification. The length can be set within the range of 4 to 8 digits, with a default value of 6 digits.
Template of text to send to the userAdd phone message template, include code attribute in your text to map the generated OTP. Eg. Your OTP is code
SMS SenderBy default, all SMS are sent through the default SMS Provider configured for the system. If you prefer to use your own sms provider, instructions on how to configure this can be found here.

5 After you've configured everything needed, click on the SAVE button.

6 Proceed to attach the workflow to the relevant application for execution. Refer to instructions on how to attach a workflow to an application here.

Expected result

Based on the provided configuration, the information that will be fetched for Verify Phone with OTP includes the following parameters:

NameDescription
phone_verifiedThis denotes whether the phone verification is completed. The value will be "True" if the verification is successfully completed and "False" if it is not.
phoneRefers to the phone number being validated or verified.
phone_verified_atThis provides a timestamp, in Unix epoch format, indicating the exact time when the phone number verification was completed. This allows you to know precisely when the verification event occurred.
phone_regionRefers to the country code associated with the phone number.

The response received will include the accurate information mentioned above. Note that, the response values can vary depending on the specific workflow modules.

How it works,

1 Launch Postman or your preferred API tool and execute the flow by configuring the suitable Method, URL, and Body settings. If you're seeking guidance on how to perform these actions, see here.

2 Upon initiating the API call, a verification request will be sent to your configured Verification Way settings.

3 Based on the request, execute the flow in an incognito browser and follow the prompts to complete the verification process.

4 Begin by providing the Phone Number and click on Verify.

Phone

5 An OTP will be sent to the phone number provided above. Please input the OTP and click on Submit to proceed.

OTP

6 The verification process will be completed only if the entered data is valid.

If "force onboarding" is enabled in the API request, all users, regardless of status, will be directed to the onboarding flow first, followed by the verification flow if configured.

Completed

7 The response can differ depending on the chosen Verification Way and Notification Way configurations. To know more, see here.

8 Here is a sample response for Verify Phone with OTP:

{
"workflow": "verification",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"user_id": "mark@gmail.com",
"phone_verified": "true/false",
"phone": "98xxxxxxxx",
"phone_verified_at": "1719569072",
"phone_region": "in",
}